-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fix second init on spark account not allowing choosing a sql instance #9504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @tammam-g, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request resolves an issue within the Spark account initialization process where users faced difficulties in selecting a SQL instance, particularly during a second initialization. The changes refine the user experience by providing more informative prompts regarding billing requirements for new CloudSQL instances and by ensuring that appropriate upgrade instructions are presented at the correct stage when a free trial has been utilized and a billing account is necessary. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request refactors the Cloud SQL instance selection flow during firebase init dataconnect for users on the Spark plan. The changes correctly move the logic for handling billing requirements to a later stage, only after the user explicitly chooses to create a new paid instance. Additionally, the user-facing prompt is improved for clarity. The overall change improves the user experience and fixes the described issue. I have one minor suggestion to improve code clarity by removing a redundant fallback.
| setup.instructions.push( | ||
| upgradeInstructions(setup.projectId || "your-firebase-project", true), | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The promptForCloudSQL function includes a guard at the beginning (if (!setup.projectId) { return; }), which ensures that setup.projectId is always defined at this point in the code. Consequently, the fallback to "your-firebase-project" is redundant.
Removing this fallback and relying on the established contract that setup.projectId exists will make the code cleaner and prevent the generation of a non-functional URL in the unlikely scenario that the initial guard is removed and setup.projectId is falsy.
| setup.instructions.push( | |
| upgradeInstructions(setup.projectId || "your-firebase-project", true), | |
| ); | |
| setup.instructions.push( | |
| upgradeInstructions(setup.projectId!, true), | |
| ); |
Spark account can choose to use existing free instance or choose a new instance to be provisioned later

If new instance is chosen and free trial is used we will print upgrade instructions at the end